/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  							 script_set_player_message.h

	$Header: /heroes4/script_set_player_message.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( SCRIPT_SET_PLAYER_MESSAGE_H_INCLUDED )
#define SCRIPT_SET_PLAYER_MESSAGE_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <iosfwd>
#include <string>

#include "script_player_action.h"

// --------------------------------------------------------------------------
// t_script_set_player_message class
// --------------------------------------------------------------------------

class t_script_set_player_message : public t_script_player_action
{
public:
	// Member functions
	std::string const &	get_text() const;
	virtual bool		read_from_map(
							std::streambuf &	stream,
							int					format_version );
	virtual bool		read( std::streambuf &	stream, int version );
	virtual bool		write( std::streambuf& stream ) const;

private:
	// Data members
	std::string	m_text;
};

class t_script_set_loss_condition_text : public t_script_set_player_message
{
protected:
	virtual void		do_action( t_adventure_map* map, t_player* player ) const;
};

class t_script_set_win_condition_text : public t_script_set_player_message
{
protected:
	virtual void		do_action( t_adventure_map* map, t_player* player ) const;
};

// --------------------------------------------------------------------------
// t_script_set_player_message inline members
// --------------------------------------------------------------------------

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
inline std::string const & t_script_set_player_message::get_text() const
{
	return m_text;
}

SPECIALIZE_SCRIPT_ACTION( k_script_action_set_loss_condition_text, t_script_set_loss_condition_text );
SPECIALIZE_SCRIPT_ACTION( k_script_action_set_loss_message, t_script_set_player_message );
SPECIALIZE_SCRIPT_ACTION( k_script_action_set_victory_condition_text, t_script_set_win_condition_text );
SPECIALIZE_SCRIPT_ACTION( k_script_action_set_victory_message, t_script_set_player_message );

#endif // !defined( SCRIPT_SET_PLAYER_MESSAGE_H_INCLUDED )
